import request from '@/utils/request'

// 创建抽奖
export function createLottery(data) {
  return request({
    url: '/qd/lottery/create',
    method: 'post',
    data: data
  })
}

// 更新抽奖
export function updateLottery(data) {
  return request({
    url: '/qd/lottery/update',
    method: 'put',
    data: data
  })
}

// 删除抽奖
export function deleteLottery(id) {
  return request({
    url: '/qd/lottery/delete?id=' + id,
    method: 'delete'
  })
}

// 获得抽奖
export function getLottery(id) {
  return request({
    url: '/qd/lottery/get?id=' + id,
    method: 'get'
  })
}
// 获得抽奖
export function getLotteryInfo(id) {
  return request({
    url: '/qd/lottery/getLotteryInfo?id=' + id,
    method: 'get'
  })
}

// 获得抽奖
export function change(id,code) {
  return request({
    url: '/qd/lottery/change?id=' + id+'&code='+code,
    method: 'get'
  })
}

// 获得抽奖分页
export function getLotteryPage(query) {
  return request({
    url: '/qd/lottery/page',
    method: 'get',
    params: query
  })
}

// 获得抽奖信息分页
export function getLotteryInfoPage(query) {
  return request({
    url: '/qd/lottery/infoPage',
    method: 'get',
    params: query
  })
}

// 导出抽奖 Excel
export function exportLotteryExcel(query) {
  return request({
    url: '/qd/lottery/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
